<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
<script src="js/jquery-1.5.1.min.js"></script>
<script type='text/javascript'>
function doAjaxPost(){
$.ajax({
  type: "POST",
  url: "/json/ShowLoginUsers.htm",
  contentType: "application/json; charset=UTF-8",
  dataType: "json",
  //data : mydata, 
  success: function(data) {
  	var o = eval(data);
  	createShowingTable(data);
  },
  error:function(){
  	alert("异常，请稍候再试！");
  		}
	});
}

  //动态的创建一个table，同时将后台获取的数据动态的填充到相应的单元格
  function createShowingTable(data){
  //获取后台传过来的jsonData,并进行解析
  alert("------->进入当前的数据展现");
 // var dataArray = $.parseJSON(data.jsonData);
  //此处需要让其动态的生成一个table并填充数据
  var tableStr = "<table>";
  tableStr = tableStr + "<thead><td>ID</td><td>NAME</td><td>PASSWORD</td><td>MEMO</td><td>IS_ADMIN</td><td>CREATE_TIME</td><td>UPDATE_TIME</td><td>END_TIME</td><td>CREATED_BY</td><td>UPDATED_BY</td><td>SYSTEMMODSTAMP</td></thead>";

  var len = data.length;
  if(len>=10){
  len = 10;
  }
  for(var i=0 ;i<=len ; i++){
  tableStr = tableStr + "<tr><td>"+ data[i].id +"</td>"+"<td>"+data[i].username + "</td>"+"<td>"+data[i].password +"</td>"+"<td>"+data[i].memo+"</td>"+"<td>"+data[i].is_admin+"</td>"+ data[i].created_time +"</td>"+"<td>"+data[i].updated_time +"</td>"+data[i].end_time +"</td>"+data[i].created_by +"</td>"+data[i].updated_by +"</td>"+data[i].systemmodstamp +"</td></tr>"; 
  //</tr>"+"<td>"+data[i].created_time +"</td></tr>"+"<td>"+data[i].updated_time +"</td></tr>"
  //+"<td>"+data[i].end_time +"</td></tr>"+"<td>"+data[i].created_by +"</td></tr>"+"<td>"+data[i].updated_by +"</td></tr>"+"<td>"+data[i].systemmodstamp 
  }
  tableStr = tableStr + "</table>";
  //将动态生成的table添加的事先隐藏的div中.
  $("#dataTable").html(tableStr);  
  }  

</script>
</head>
<body style="color: green;">

	<div  id="dataTable" style="padding-top:12px; text-align:left">
		<a href="javascript:getJosnData()">
    		<font color="#00bbff">
    			<bean:message key="ec.apply.license.showlog"/> 
    		</font>
		</a>
	</div>
	  <input type="button" value="Show All Users" onclick="doAjaxPost()"><br/>
	<a href="/json/AddUser.htm">Back AddUser...</a>
</body>
</html>